feat: support apisix plugin config#166
Merged
Merged
Conversation
Signed-off-by: ashing <axingfly@gmail.com>
…t_apisix_plugin_config Signed-off-by: ashing <axingfly@gmail.com>
Contributor
conformance test reportapiVersion: gateway.networking.k8s.io/v1
date: "2025-06-18T08:21:57Z"
gatewayAPIChannel: standard
gatewayAPIVersion: v1.2.0
implementation:
contact: null
organization: APISIX
project: apisix-ingress-controller
url: https://github.com/apache/apisix-ingress-controller.git
version: v2.0.0
kind: ConformanceReport
mode: default
profiles:
- core:
result: partial
skippedTests:
- HTTPRouteHTTPSListener
statistics:
Failed: 0
Passed: 32
Skipped: 1
name: GATEWAY-HTTP
summary: Core tests partially succeeded with 1 test skips. |
Contributor
conformance test reportapiVersion: gateway.networking.k8s.io/v1
date: "2025-06-18T08:22:29Z"
gatewayAPIChannel: standard
gatewayAPIVersion: v1.2.0
implementation:
contact: null
organization: APISIX
project: apisix-ingress-controller
url: https://github.com/apache/apisix-ingress-controller.git
version: v2.0.0
kind: ConformanceReport
mode: default
profiles:
- core:
failedTests:
- HTTPRouteCrossNamespace
result: failure
skippedTests:
- HTTPRouteHTTPSListener
statistics:
Failed: 1
Passed: 31
Skipped: 1
name: GATEWAY-HTTP
summary: Core tests failed with 1 test failures. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for the ApisixPluginConfig CRD throughout the controller stack, enabling plugin configurations to be referenced, indexed, and applied in translated APISIX routes.
- Extend
TranslateContextto holdApisixPluginConfigsand wire them into the translation pipeline - Refactor the ADC translator (
TranslateApisixRoute) to load plugins from both route‐level and PluginConfig resources - Implement a new
ApisixPluginConfigReconciler, register watches, and index routes by PluginConfig references
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/provider/provider.go | Added ApisixPluginConfigs field to TranslateContext |
| internal/provider/adc/translator/apisixroute.go | Refactored route translation to build timeouts, plugins, etc. |
| internal/manager/controllers.go | Registered the ApisixPluginConfigReconciler |
| internal/controller/utils.go | Introduced KindApisixPluginConfig constant |
| internal/controller/indexer/indexer.go | Added indexer for PluginConfig references |
| internal/controller/apisixroute_controller.go | Updated watcher and processing to include PluginConfig refs |
| internal/controller/apisixpluginconfig_controller.go | New reconciliation logic for ApisixPluginConfig |
Comments suppressed due to low confidence (2)
internal/controller/indexer/indexer.go:41
- [nitpick] Consider renaming this constant to ApisixPluginConfigIndexRef to clearly indicate it indexes ApisixPluginConfig resources and maintain consistency with other index constants.
PluginConfigIndexRef = "pluginConfigRefs"
internal/provider/adc/translator/apisixroute.go:48
- The new translateHTTPRule helper encapsulates critical routing and plugin logic. Consider adding unit tests to validate its behavior across different PluginConfig and timeout scenarios.
func (t *Translator) translateHTTPRule(tctx *provider.TranslateContext, ar *apiv2.ApisixRoute, rule apiv2.ApisixRouteHTTP, ruleIndex int) (*adc.Service, error) {
dspo
reviewed
Jun 18, 2025
dspo
reviewed
Jun 18, 2025
dspo
approved these changes
Jun 18, 2025
Comment on lines
+70
to
+80
| if client.IgnoreNotFound(err) == nil { | ||
| pc.Namespace = req.Namespace | ||
| pc.Name = req.Name | ||
| pc.TypeMeta = metav1.TypeMeta{ | ||
| Kind: KindApisixPluginConfig, | ||
| APIVersion: apiv2.GroupVersion.String(), | ||
| } | ||
|
|
||
| return ctrl.Result{}, nil | ||
| } | ||
| return ctrl.Result{}, err |
Contributor
There was a problem hiding this comment.
Suggested change
| if client.IgnoreNotFound(err) == nil { | |
| pc.Namespace = req.Namespace | |
| pc.Name = req.Name | |
| pc.TypeMeta = metav1.TypeMeta{ | |
| Kind: KindApisixPluginConfig, | |
| APIVersion: apiv2.GroupVersion.String(), | |
| } | |
| return ctrl.Result{}, nil | |
| } | |
| return ctrl.Result{}, err | |
| return ctrl.Result{}, client.IgnoreNotFound(err) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: ashing axingfly@gmail.com
Type of change:
What this PR does / why we need it:
Pre-submission checklist: